import java.util.Locale;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ling
 * Date: 2022-04-11
 * Time: 10:58
 */
public class TestDemo1 {
    public static void main(String[] args) {
        String str="HelloWorld";
        char[] s=str.toCharArray();
        StringBuffer buffer=new StringBuffer();
        for (int i = s.length-1; i >=0 ; i--) {
            if(s[i]<='A'&&s[i]>='Z'){
                buffer.append(String.valueOf(s[i]).toLowerCase());
            }
            else
                buffer.append(String.valueOf(s[i]).toUpperCase());
        }
        System.out.println(buffer.toString());
    }

}
